﻿Imports System.IO

Public Class Plateforme
    Public nom As String
    Public domain As String
    Public login As String
    Public password As String
    Public destination As String

    Sub New(obj As XElement)
        Me.nom = obj.@nom
        Me.domain = obj.@domain
        Me.login = obj.@login
        Me.password = obj.@password
        Me.destination = obj.@destination
    End Sub

    Sub reFill(obj As XElement)
        Me.nom = obj.@nom
        Me.domain = obj.@domain
        Me.login = obj.@login
        Me.password = obj.@password
        Me.destination = obj.@destination
    End Sub
End Class

Public Class Serveur
    Public nom As String
    Public ip As String
    Public nbJourRetention As Integer
    Public pltParent As Plateforme

    Sub New(obj As XElement, ByRef _pltParent As Plateforme)
        Me.nom = obj.@nom
        Me.ip = obj.@ip
        Me.nbJourRetention = obj.@nbJourRetention
        Me.pltParent = _pltParent
    End Sub

    Sub reFill(obj As XElement)
        Me.nom = obj.@nom
        Me.ip = obj.@ip
        Me.nbJourRetention = obj.@nbJourRetention
    End Sub
End Class

Public Class Chemin
    Public typeLogs As String
    Public destDossier As String
    Public source As String
    Public srvParent As Serveur

    Sub New(obj As XElement, ByRef _srvParent As Serveur)
        Me.destDossier = obj.@destdossier
        Me.source = obj.Value
        Me.typeLogs = obj.@typelogs
        Me.srvParent = _srvParent
    End Sub

    Sub reFill(obj As XElement)
        Me.destDossier = obj.@destdossier
        Me.source = obj.Value
        Me.typeLogs = obj.@typelogs
    End Sub
    Public Function getFullPathSource() As String
        Return "\\" & Me.srvParent.ip & "\" & Me.source
    End Function

    Public Function getFullPathDestination() As String
        Return Me.srvParent.pltParent.destination & "\" & Me.srvParent.pltParent.nom & "\" & Me.srvParent.nom & "\" & Me.destDossier
    End Function
End Class

Public Class SourceLogReturn
    Public except As Exception
    Public repertoires As DirectoryInfo()
    Public fichiers As FileInfo()
End Class